import QtQuick 2.0

Rectangle {
    width: 480; height: 320
    id: rootItem
    color: "#eeeeee"

    Text {
        id: label
        text: "This is a simple test"
        anchors.centerIn: parent
        color: "blue"
        font { bold: true; pixelSize: 24; family: "source code pro"}
        MouseArea{
            id: mouseAre
            anchors.fill: parent
        }
        states:[
            State {
                name: "red"
                when: mouseAre.pressed
                PropertyChanges {
                    target: label
                    font.pixelSize: 32
                    font.italic: true
                    color: "red"
                }
            },
            State {
                name: "blue"
                PropertyChanges {
                    target: label
                    font.pixelSize: 24
                    color: "blue"
                    font.italic: false
                }
            }
        ]
    }

    Timer{
        id: timer
        interval: 1000
        repeat: true
        onTriggered: {
            label.state = "red";
            durTimer.start();
        }
    }
    Timer{
        id: durTimer
        interval: 150
        repeat: false
        onTriggered: {
            label.state = "blue";
        }
    }
    Component.onCompleted: {
        timer.start();
    }
}

